/*
 * @Author: CemCode cemoment@aliyun.com
 * @Date: 2022-01-19 19:12:10
 * @LastEditors: CemCode cemoment@aliyun.com
 * @LastEditTime: 2023-04-02 04:53:56
 * @FilePath: \nodejs-blog-admin\router\admin\article_manage.js
 * @Description: 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi");
const schema = require("../../schema/admin/article_manage");
const handler = require("../../router_handler/admin/article_manage");

// 获取文章列表
router.get("/getArticleList",expressJoi(schema.getArticleList_schema),handler.getArticleList);

// 添加文章
router.post("/addArticle",expressJoi(schema.addArticle_schema),handler.addArticle);

// 修改文章
router.post("/updateArticle",expressJoi(schema.updateArticle_schema),handler.updateArticle);

// 删除文章
router.post("/delArticle",expressJoi(schema.delArticle_schema),handler.delArticle);

// 新增类别
router.post("/addType",expressJoi(schema.add_type_schema),handler.addType);

// 修改类别
router.post("/updateType",expressJoi(schema.update_type_schema),handler.updateType);

// 删除类别
router.post("/delType",expressJoi(schema.del_type_schema),handler.delType);

// 新增标签
router.post("/addLabel",expressJoi(schema.add_label_schema),handler.addLabel);

// 修改标签
router.post("/updateLabel",expressJoi(schema.update_label_schema),handler.updateLabel);

// 删除标签
router.post("/delLabel",expressJoi(schema.del_label_schema),handler.delLabel);

// 获取文章类别
router.get("/types",expressJoi(schema.get_types_schema),handler.getTypeList)

// 获取文章标签
router.get("/labels",expressJoi(schema.get_labels_schema),handler.getLabelList)

// 
module.exports = router;
